<script type="text/javascript" src="/theme/default/resource/js/lib/masonry.min.js"></script>
<div id="pageContent" class="typePage">
    <div id="typeHeader" style="background-image: url('{$type->show_thumb}');">
        <div class="w1100 mc">
            <h1 class="text-center">
               {$type->name}
                <span>
                    {$type->description}
                </span>
            </h1>
        </div>
    </div>
    <div class="tablist">
        <div class="w1100 mc">
            <ul>
                <li>
                    <a href="{:url('index/type',['type'=>$type->en_name])}" {if !$do_type}class="active"{/if}>
                        <img src="/theme/default/resource/img/gif.png" alt="" width="25" height="25">
                        <span>所有{$type->name}</span>
                    </a>
                </li>
                {foreach $c_type as $val}
                <li>
                    <a href="{:url('index/type',['type'=>$type->en_name,'c_type'=>$val->en_name])}" {if $val->en_name==$do_type}class="active"{/if}>
                        {if $val->thumb}
                        <img src="{$val->thumb}" style="border-radius: 100%;" alt="" width="25" height="25">
                        {/if}
                        <span>{$val->name}</span>
                    </a>
                </li>
                {/foreach}
            </ul>
        </div>
    </div>
    <div class="tabflag w1100 mc">
        <ul>
            <li>
                <a href="{:url('index/type',['type'=>$type->en_name,'c_type'=>$do_type])}" {if $do_flag==''}class="active"{/if}>所有标签</a>
            </li>
            {foreach $flag as $val }
            <li>
                <a href="{:url('index/type',['type'=>$type->en_name,'c_type'=>$do_type,'flag'=>$val->en_name])}" {if $do_flag==$val->en_name}class="active"{/if}>{$val->name}</a>
            </li>
            {/foreach}
        </ul>
    </div>

    <div class="w1100 mc grid" style="width: 1200px;">
        {foreach $shop as $val}
        <div class="grid-item grid-1">
            <div class="works">
                <ul>
                    <li class="thumb">
                        <img width="100%" height="auto" src="{$val->thumb}" alt="">
                        <a href="{:url('index/works',['id'=>$val->id])}"></a>
                        <span class="clear">&nbsp;</span>
                    </li>
                    <li class="title">
                        <p>{$val->title}</p>
                    </li>
                    <li class="user-info">
                        <a href="">
                            <img class="img-cly" height="30" width="30" src="http://cdn.uehtml.com/201611/1479700031861.jpg" alt="">
                            <p>
                                <span class="nick-name">王小江</span> 发表于
                                <span class="date-time">2017-04-07 13:03</span>
                            </p>
                        </a>
                    </li>
                </ul>
            </div>
        </div>
        {/foreach}
    </div>
</div>
<script type="text/javascript">
    $(function () {
        $("#footer").hide();
        var options =
            {
                srcNode: '.grid-item',             // grid items (class, node)
                margin: '25px',             // margin in pixel, default: 0px
                width: '200px',             // grid item width in pixel, default: 220px
                max_width: '',              // dynamic gird item width if specified, (pixel)
                resizable: true,            // re-layout if window resize
                transition: 'all 0.5s ease' // support transition for CSS3, default: all 0.5s ease
            }
        $('.grid').gridify(options);

        //page.initFooter(); //底部导航重置

        /*var grid = $('.grid').masonry({
            itemSelector: '.grid-item',
            columnWidth: 220,
            isInitLayout: false
        });

        function onLayout() {
            page.initFooter(); //底部导航重置
        }
        grid.masonry('on','layoutComplete',onLayout);
        grid.masonry();*/
    });
</script>